package com.aspose.cells.a.d;

public class zek extends zef {
   public String a;
   public int b;
   public zdj c;
   public zek d;
   public zek g;
   public zek h;
   public zek i;
   public zek j;
   public boolean k = false;

   public zek(zdh var1, String var2, int var3, zdj var4, boolean var5) throws Exception {
      super(var1);

      assert var2 != null;

      this.a = var2;
      this.b = var3;
      this.c = var4;
      this.k = var5;
   }

   public void a(zeg var1) throws Exception {
      var1.a(this);
      var1.g();
      var1.c("/Title", this.a);
      var1.a("/Parent", this.d.n());
      if (this.g != null) {
         var1.a("/Prev", this.g.n());
      }

      if (this.h != null) {
         var1.a("/Next", this.h.n());
      }

      if (this.i != null) {
         var1.a("/First", this.i.n());
      }

      if (this.j != null) {
         var1.a("/Last", this.j.n());
      }

      if (this.i != null) {
         int var2 = this.b();
         var1.a("/Count", var2);
      }

      var1.a("/Dest");
      this.c.a(var1);
      var1.h();
      var1.b();

      for(zek var3 = this.i; var3 != null; var3 = var3.h) {
         var3.a(var1);
      }

   }

   public void a(zek var1) {
      if (this.i == null) {
         this.i = var1;
      } else {
         this.j.h = var1;
         var1.g = this.j;
      }

      this.j = var1;
      var1.d = this;
   }

   private int b() {
      int var1 = 0;

      for(zek var2 = this.i; var2 != null; var2 = var2.h) {
         ++var1;
      }

      return this.k ? var1 : -var1;
   }
}
